/**
 * 
 */
package post.graduate.go.ready.experiment.nekohtml;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;

import org.xml.sax.SAXException;

/**
 * @author lihb
 *
 */
public class NekohtmlParserTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		NekohtmlParser parser = new NekohtmlParser(
				"http://www.amazon.cn/mn/article?pageName=book&pageIdent=adv_sr_book");   
				//"http://www.china-pub.com/search/search_index.asp");
				//"http://search.dangdang.com/AdvanceSearch/AdvanceSearch.aspx?c=0");  // dangdang 
				//"http://book.beifabook.com/Customer/Searchbooks.aspx"); // beifabook
		try {
			parser.dealParper();
			List<String> inputList = parser.getInputList();
			for(String input : inputList)
			{
				System.out.println(input);
			}
			List<String> actionUrlList = parser.getActionURLList();
			for(Iterator<String> it = actionUrlList.iterator();it.hasNext();)
			{
				System.out.println(it.next());
			}
		} catch (RuntimeException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (SAXException e) {
			e.printStackTrace();
		}
	}

}
